<%@ include file="/templates/menu.jsp" %>

<%@ page errorPage="/templates/commonErrorPage.jsp" %>

<%@ page import="com.training.dto.Employee" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

	<form action="searchEmp" method="post">

		Employee ID : <input type="text" name="empId"> <br>
		 
		<input
			type="submit">

	</form>
	<br><br><br>
	
	
	<form action="searchMultiEmp" method="post">

		Employee Name (First Or Last) : <input type="text" name="empName"> <br>
		 
		<input
			type="submit">

	</form>

	<%!Employee employee = null;%>

	<%
	  	//employee.getFirstName();
		employee = (Employee) request.getAttribute("searchedEmployee");

		if (employee != null) {
	%>
	<form action="updateEmp" method="post">
	<table border="2" background="blue">
		<thead>
			<tr>
				<th>First Name</th>
				<th>Employee ID </th>
				<th>Last Name</th><th>Action</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><input type="text" name="empFirstName"value="<%=employee.getFirstName()%>" /></td>
				<td><%=employee.getEmpId()%></td>
				<td><input type="text" name="empLastName"value="<%=employee.getLastName()%>"  /></td>
				<td> <input type="submit" value="update Employee">  </td>
			</tr>
		</tbody>
	</table>
</form>
	<%
		} else {
	%>
	<h1>Please search with Another Employee ID</h1>
	<%
		}
	%>
<%@ include file="/templates/footer.jsp" %>
</body>
</html>